package com.igeek.utils;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
@Component
public class LifeCycleBean {

    public LifeCycleBean() {
        System.out.println("LifeCycleBean构造器调用了");
    }

    @PostConstruct //==标明初始化方法 ---相当于 init-method 指定初始化方法
    public void init(){
        System.out.println("LifeCycleBean-init初始化时调用");
    }

    @PreDestroy//标明销毁方法  ----相当于 destroy-method 指定对象销毁方法
    public void destroy(){
        System.out.println("LifeCycleBean-destroy销毁时调用");
    }

    public void save(){
        System.out.println("call save");
    }
}
